<?php
include_once "conn.php";
$token=$_GET['token'];
$arr=[];
$sql=$db->query("SELECT 
    order_goods_id,order_time,order_goods.order_user_id,
    order_num,goods_price,goods_title,goods_url
    FROM order_user 
        JOIN order_goods ON order_user.`order_user_id` = order_goods.`order_user_id`
        JOIN goods ON order_goods.`goods_id` = goods.`goods_id` 
        JOIN user ON user.user_id = order_user.`user_id`
        WHERE user_token = '$token' ORDER BY order_time DESC");
while ($row = $sql -> fetch_assoc()) {
    array_push($arr,$row);
}
echo json_encode($arr);
$db->close();
?>